
package com.zcp.wizard;

import android.app.Activity;
import android.os.Bundle;

import java.util.Timer;
import java.util.TimerTask;

public class BrightnessSettingsActivity extends Activity {

    private void finishActivity() {
        Timer localTimer = new Timer();
        MyTimerTask local = new MyTimerTask(this);
        localTimer.schedule(local, 300);
    }

    private void setBrightness(int paramInt) {
        Util.setBrightness(this, paramInt);
        Util.updateBrightnessData(this, paramInt);
        finishActivity();
    }

    protected void onCreate(Bundle paramBundle) {
        super.onCreate(paramBundle);
        setBrightness((int) (255 * Constants.minBrightness));        
    }
    
    class MyTimerTask extends TimerTask {
//        Activity activity;

        public MyTimerTask(Activity activity) {
//            this.activity = activity;
        }

        public void run() {        
//            activity.finish();
            finishMySelf();
        }
    }
    
    private void finishMySelf()
    {
        try {
              this.finish();
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }

}
